package com.aote.entity.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.w3c.dom.Element;

import com.aote.mvc.event.Action;
import com.browsesoft.ExtendElement;
import com.browsesoft.baseadapter.BasicEntity;
import com.browsesoft.oa.BSHttpServletRequest;

public class CommissionAction extends Action {

	public void performAction(Element config, HttpServletRequest request,
			Map attrs) {
		try {
			String accept = (String) attrs.get("isaccept");
			if (accept.equals("同意")) {
				BasicEntity entity = (BasicEntity) this.component.getModel();
				Element state = (Element) ExtendElement.findElements(
						this.component.getElement(), "name", "f_state").get(0);
				state.setAttribute("f_state", "正在委托");
				entity.attributes.put("f_state", "正在委托");
				attrs.put("f_state","正在委托");
				entity.update();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
